#!/usr/bin/env python2.5
#coding: utf8

#Author: Gang Li
#Date: 2010-04-10 18:20

#command id
CMD_CURSOR = 50
def inc_cmd_cursor():
    global CMD_CURSOR
    CMD_CURSOR += 1
    return CMD_CURSOR

VERIFY_CMD = "ve"
VERIFY_REQ = "%s%s" % (VERIFY_CMD, inc_cmd_cursor())
VERIFY_RSP = "%s%s" % (VERIFY_CMD, inc_cmd_cursor())
VERIFY_OK = "%s%s" % (VERIFY_CMD, inc_cmd_cursor())

NODE_REG = "%s" % (inc_cmd_cursor())
NODE_REG_OK = "%s" % (inc_cmd_cursor())

DATA = inc_cmd_cursor()

HEART_BEAT_REQ = "%s" % inc_cmd_cursor()
HEART_BEAT_RSP = "%s" % inc_cmd_cursor()

CLIENT_RECONNECT = "%s" % inc_cmd_cursor() 
CLIENT_RECONNECT_OK = "%s" % inc_cmd_cursor() 

START_TASK = "%s" % inc_cmd_cursor() 
START_TASK_OK = "%s" % inc_cmd_cursor() 

TASK_NODE_ALLOC = "%s" % inc_cmd_cursor()
TASK_NODE_ALLOC_RSP = "%s" % inc_cmd_cursor()

START_SUB_TASK = "%s" % inc_cmd_cursor() 
START_SUB_TASK_OK = "%s" % inc_cmd_cursor() 

SUB_TASK_DONE = "%s" % inc_cmd_cursor() 

#==========file system cmd==============
FS_CMD = "fs"
#from client node
REG_FILE = "%s%s" % (FS_CMD, inc_cmd_cursor())
REG_FILE_OK = "%s%s" % (FS_CMD, inc_cmd_cursor())

REG_DIR = "%s%s" % (FS_CMD, inc_cmd_cursor())
REG_DIR_OK = "fs%s" % inc_cmd_cursor()
 
#server allocated file
ADD_FILE = "%s%s" % (FS_CMD, inc_cmd_cursor()) 
ADD_FILE_OK = "%s%s" % (FS_CMD, inc_cmd_cursor())

ADD_DIR = "%s%s" % (FS_CMD, inc_cmd_cursor())
ADD_DIR_OK = "%s%s" % (FS_CMD, inc_cmd_cursor())

#read file
READ_FILE = "fs%s" % inc_cmd_cursor()
